package gaobo.arraylist;

public class TestList {
    public static void main(String[] args) {
        MyArrayList myArrayList = new MyArrayList();
        myArrayList.add(1);
        myArrayList.add(2);
        myArrayList.add(3);
        myArrayList.display();
        System.out.println("=========");
        try {
            myArrayList.add(1,10);
        }catch (PosWrongfulException e){
            e.printStackTrace();
        }

        myArrayList.display();
        System.out.println("=========");
        System.out.println(myArrayList.contains(10));
        System.out.println(myArrayList.contains(11));
        System.out.println(myArrayList.get(0));
        System.out.println("=========");
        try {
            System.out.println(myArrayList.get(1));
        }catch (EmptyException e){
            e.printStackTrace();
        }
        System.out.println("=========");
        myArrayList.set(0,99);
        myArrayList.display();
        System.out.println("=========");
        System.out.println(myArrayList.size());
        System.out.println("=========");
        myArrayList.remove(3);
        myArrayList.display();
        System.out.println("=========");
        myArrayList.clear();
        myArrayList.display();
    }
}
